feat(cli): add OpenCode-compatible workspace diff viewer - #1945
Merged
Conversation
Expose a bounded HEAD-to-worktree snapshot through Runtime Git ports and Shared IPC. Add the OpenCode-compatible /diff TUI with responsive navigation and fail-closed worktree and remote boundaries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更概述
/diff入口,不新增 alias 或快捷键;仅在 Turn 空闲时可用,支持n/p切换文件、[/]跳转 hunk、方向键及 PageUp/PageDown 滚动。services-integrations持有 Git 仓库发现、状态与HEAD到工作树净补丁计算,通过 Runtime Port 同时供 Embedded 与 Shared TUI 使用;Shared IPC 协议升级到 v11。架构与边界
GitPort,Runtime/SDK/IPC 复用同一契约。/diff为只读能力,不包含 split diff、stage/reset/commit、变更归因、watcher、Remote 或 Relay 映射。验证
cargo check --workspacecargo test -p bitfun-runtime-ports --test git_port_contractscargo test -p bitfun-services-integrations --no-default-features --features git --test git_contracts(24 passed)cargo test -p bitfun-agent-runtime --test sdk_smoke(6 passed)cargo test -p bitfun-agent-runtime-ipc(51 passed)cargo test -p bitfun-core local_runtime_services_bind_git_queries_to_the_canonical_workspace -- --nocapturecargo test -p bitfun-cli(519 unit tests 及 CLI integration tests passed)node scripts/check-core-boundaries.mjs补充:尝试执行
cargo test --workspace时,被未触及文件中的既有 test-only 缺失导入阻断:services/terminal/src/exec.rs缺少PathBuf,services-integrations/src/plugin_source.rs缺少native_path_identity;上述 production workspace check 与本 PR 范围测试均通过。